//
//  NameEntity.m
//  HYApp
//
//  Created by Jianbo Cai on 2020/9/7.
//  Copyright © 2020 Unidax. All rights reserved.
//

#import "NameEntity.h"

@interface NameEntity ()
@property (nonatomic, strong) NSString *name;
@end

@implementation NameEntity

+ (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper {
    return @{
             @"en_US": @"en-US",
             @"zh_CN": @"zh-CN",
             @"zh_HK": @"zh-HK"
             };
}

- (NSString *)name {
    if (!_name) {
        NSString *string = [JFInternationalHelper currentLanguage];
        if ([string isEqualToString:@"zh-Hans"]) {
            _name = self.zh_CN;
        }else if ([string isEqualToString:@"zh-Hant"]) {
            _name = self.zh_HK;
        }else {
            _name = self.en_US;
        }
    }
    return _name;
}

@end
